// 这是用户模块。有自己的state/actiontype/actioncreator/reducer
const initState = {
  userInfo: {
    name: 'Tom',
    age: 18
  }
}
const actionType = {
  SETINFO: 'SETINFO'
}
export const actions = {
  setInfo: (info)=>({type: actionType.SETINFO, info: info})
}
const userReducer = (state=initState, action)=>{
  switch(action.type) {
    case actionType.SETINFO :
     return {
      userInfo: {...action.info}
     }
    default :
     return state
  } 
}
export default userReducer